package com.example.demo.Entity;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;

import org.hibernate.annotations.CreationTimestamp;

import javax.persistence.*;
import java.util.Date;

/**
 * @version: V0.3
 * @author: 郑皓杰 吴嘉鑫
 * @className: Company
 * @packageName: com.example.demo.Entity
 * @description: 这是公司实体类
 * @data: 2021-07-14
 **/



@JsonIgnoreProperties({"hibernateLazyInitializer","handler"})//是因为查询到的对象是null值没有获取到，无法反序列化为json 返回到前台
@Entity
@Table(name="company")
public class Company {
	/**
	 * 公司ID
	 */
	@Id
	private Integer companyID;
	
	/**
	 * 公司名
	 */
	private String companyName;

	@CreationTimestamp
	@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
	private Date updated;
	
	@CreationTimestamp
	@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
	private Date created;

	public Integer getCompanyID() {
		return companyID;
	}

	public void setCompanyID(Integer companyID) {
		this.companyID = companyID;
	}

	public String getCompanyName() {
		return companyName;
	}

	public void setCompanyName(String companyName) {
		this.companyName = companyName;
	}

	public Date getUpdated() {
		return updated;
	}

	public void setUpdated(Date updated) {
		this.updated = updated;
	}

	public Date getCreated() {
		return created;
	}

	public void setCreated(Date created) {
		this.created = created;
	}

	@Override
	public String toString() {
		return "Company [companyID=" + companyID + ", companyName=" + companyName + ", updated=" + updated
				+ ", created=" + created + "]";
	}
	
	
}
